import {http} from "../utils/http"

interface provice{
  code:string,
  name:string
}
interface cityparam{
  provinceCode:string
}
interface areaparam{
  cityCode:string
}
interface city{
  code:string,
  name:string
  provinceCode:string
}
interface area{
  code:string,
  name:string
  provinceCode:string
  cityCode:string
}
type provinceData=provice[]
type cityData=city[]
type areaData=area[]
export  const getprovince=():Promise<provinceData>=>{
  return http.get<provinceData>('/province')
}

export  const getcity=(params:cityparam):Promise<cityData>=>{
  return http.get<cityData>('/city',params)
}

export  const getarea=(params:areaparam):Promise<areaData>=>{
  return http.get<areaData>('/area',params)
}
